<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>0</h1>
<h2>0</h2>
<script>
    let count = 0;

    setInterval(f,1000)
    function f() {
        count++;
        let h = document.querySelector("h1")
        h.innerText = count;
    }
    let count2 = 0;
    let timer =setInterval(function () {
        count2++
        let h = document.querySelector("h2")
        h.innerText = count2;
        if (count2==50){
            clearInterval(timer);
        }
    },100)
    setTimeout(function () {
        alert("时间到")
        prompt("今晚吃点啥")
    },3000)
</script>
</body>
</html>